<?php

use think\migration\Seeder;

class Articles extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run()
    {
        $this->insert('articles', $this->articlesData());
    }

    public function articlesData()
    {

        $arr = [];
        for ($i = 0; $i < 10; $i++) {
            $arr[] = [
                'title' => "标题{$i}",
                'description' => '描述',
                'thumbnail' => 'https://i.loli.net/2020/12/21/GoDsTVnaXy8jixC.jpg',
                'content' => '内容',
                'keywords' => '关键字',
                'create_time' => date("Y-m-d H:i:s", time()),
                'update_time' => date("Y-m-d H:i:s", time())
            ];
        }

        return $arr;

    }

}